package com.common.retrofit.methods;

import com.common.retrofit.base.BaseMethods;
import com.common.retrofit.entity.bean.HomeBean;
import com.common.retrofit.entity.bean.HomeSChatBean;
import com.common.retrofit.service.HaiNingService;

import rx.Observable;
import rx.Subscriber;

public class HomeFirstMethods extends BaseMethods {

    private static HomeFirstMethods m_ins = null;

    public static HomeFirstMethods getInstance() {
        if (m_ins == null) {
            synchronized (HomeFirstMethods.class) {
                if (m_ins == null) {
                    m_ins = new HomeFirstMethods();
                }
            }
        }
        return m_ins;
    }

    @Override
    protected String getHttpUrl() {
        return "Index/";
    }

    private HaiNingService initService() {
        return getRetrofit().create(HaiNingService.class);
    }


    public void catelist(Subscriber<HomeSChatBean> subscriber,
                      int type ,String city , String sex , int page  ) {
        Observable observable = initService().catelist(System.currentTimeMillis()+"",
                "22b3f14c9c626d0f8b31804fc0e041af",type,city,sex,page
        );
        toSubscribe(observable, subscriber);
    }
}
